//路由配置
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter)
// 在路径中的@表示固定的src文件夹
import Home from "@/views/Home.vue"
import Topic from "@/views/Topic.vue"
import Category from "@/views/Category.vue"
import Cart from "@/views/Cart.vue"
import User from "@/views/User.vue"
import Search from "@/views/Search.vue"
import Detail from '@/views/Detail.vue'
//配置路由规则
const  routes=[
               {path:"/",redirect:"/home"},
               {//首页路由
                 path:"/home",
                 component:Home,
                 children:[
                            {path:"search",
                             component:Search,
                             meta:{isShowTabbar:false}
                            }
                           ],
                  meta:{isShowTabbar:true}

               },
               {//专题路由
                path:"/topic",
                component:Topic,
                meta:{isShowTabbar:true}
               },
               {//分类路由
                path:"/category",
                component:Category,
                meta:{isShowTabbar:true}
               },
                {//购物车路由
                  path:"/cart",
                  component:Cart,
                  meta:{isShowTabbar:true}
                 },
                {//我的路由
                  path:"/user",
                  component:User,
                  meta:{isShowTabbar:true}
                },
                {
                  //详情页面
                  path:"/detail",
                  component:Detail,
                  mata:{isShowTabbar:false},
                
                  
                }

               ]
//实例化路由
const  router=   new VueRouter({routes,mode:"history"})
export default router